import javax.xml.crypto.Data;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 张宇田
 * Date: 2024-09-21
 * Time: 15:45
 */
class WashMachine{             //洗衣机类
    public String name;
    public String brand;
    public String color;
    public int length;
    public int wide;
    public int height;

    public void washClothes(){
        System.out.println("洗衣服~~~~~~~~~");
    }
    public void dryClothes(){
        System.out.println("脱水~~~~~~~~~~");
    }

}
class Date {
    public int year;
    public int month;
    public int day;

    public void setDay(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this. day = day;
    }

    public void printDate() {
        System.out.println(year + "/" + month + "/" + day);
    }

    /*public Date(int year, int month, int day){
        this(2024,5,9);

    }*/
// 构造方法：
    // 名字与类名相同，没有返回值类型，设置为void也不行
    // 一般情况下使用public修饰
    // 在创建对象时由编译器自动调用，并且在对象的生命周期内只调用一次
    /*public Date (){   //构造方法
        this.year=2024;
        this. month=9;
        this. day=21;
    }public Date (int year,int month,int day){   //构造方法
        this.year=year;
        this. month=month;
        this. day=day;
    }*/

}
public class Test {

    public static void main3(String[] args) {


        Date d1 = new Date();
        //Date d1 = new Date(2022,8,9);
        d1.printDate();
        /*Date d2 = new Date();
        Date d3 = new Date();
        d1.setDay(2020,5,7);
        d2.setDay(2023,5,7);
        d3.setDay(2024,5,7);
        d1.printDate();
        d2.printDate();
        d3.printDate();*/
    }

    public static void main2(String[] args) {
        WashMachine wm = new WashMachine();  //用new来实例化对象
        wm.brand = "海尔";
        wm.color = "蓝色";
        wm.washClothes();
        wm.dryClothes();
    }

    public static void main1(String[] args) {
        int [] arry = new int[]{1,2,3};
        System.out.println(arry);
    }
}
